package com.example.demo.service.impl;

import com.example.demo.entity.MessageEvent;
import com.example.demo.mapper.MessageEventMapper;
import com.example.demo.service.MessageEventService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
public class MessageEventServiceImpl implements MessageEventService {

    @Resource
    private MessageEventMapper messageEventMapper;


    @Override
    public boolean saveMessageEvent(MessageEvent messageEvent) {
        if (Objects.isNull(messageEvent.getTenantId())){
            return false;
        }
        int event = messageEventMapper.insertMessageEvent(messageEvent);
        if (event > 0){
            return true;
        }
        return false;
    }
}
